home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / codeli_1 / setup.exe / _SETUP.1 / frmHideTaskbar.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1997-08-18  |  3.2 KB  |  92 lines

  1. VERSION 5.00
  2. Begin VB.Form frmHideTaskbar 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Hide/Show Taskbar"
  5.    ClientHeight    =   1380
  6.    ClientLeft      =   2595
  7.    ClientTop       =   3465
  8.    ClientWidth     =   4830
  9.    Icon            =   "frmHideTaskbar.frx":0000
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    PaletteMode     =   1  'UseZOrder
  14.    ScaleHeight     =   1380
  15.    ScaleWidth      =   4830
  16.    ShowInTaskbar   =   0   'False
  17.    Begin VB.CommandButton cmdShow 
  18.       Caption         =   "&Show"
  19.       Height          =   375
  20.       Left            =   1440
  21.       TabIndex        =   1
  22.       Top             =   120
  23.       Width           =   1215
  24.    End
  25.    Begin VB.CommandButton cmdHide 
  26.       Caption         =   "&Hide"
  27.       Height          =   375
  28.       Left            =   120
  29.       TabIndex        =   0
  30.       Top             =   120
  31.       Width           =   1215
  32.    End
  33.    Begin VB.Label Label3 
  34.       Alignment       =   1  'Right Justify
  35.       AutoSize        =   -1  'True
  36.       Caption         =   "http://www.geocities.com/SiliconValley/Way/6445"
  37.       BeginProperty Font 
  38.          Name            =   "MS Sans Serif"
  39.          Size            =   8.25
  40.          Charset         =   0
  41.          Weight          =   700
  42.          Underline       =   0   'False
  43.          Italic          =   0   'False
  44.          Strikethrough   =   0   'False
  45.       EndProperty
  46.       ForeColor       =   &H00800000&
  47.       Height          =   195
  48.       Left            =   360
  49.       TabIndex        =   3
  50.       Top             =   1080
  51.       Width           =   4365
  52.    End
  53.    Begin VB.Label Label4 
  54.       Alignment       =   1  'Right Justify
  55.       AutoSize        =   -1  'True
  56.       Caption         =   "Written for the VB Center Code Library"
  57.       BeginProperty Font 
  58.          Name            =   "Small Fonts"
  59.          Size            =   6.75
  60.          Charset         =   0
  61.          Weight          =   400
  62.          Underline       =   0   'False
  63.          Italic          =   0   'False
  64.          Strikethrough   =   0   'False
  65.       EndProperty
  66.       Height          =   165
  67.       Left            =   2340
  68.       TabIndex        =   2
  69.       Top             =   840
  70.       Width           =   2355
  71.    End
  72. Attribute VB_Name = "frmHideTaskbar"
  73. Attribute VB_GlobalNameSpace = False
  74. Attribute VB_Creatable = False
  75. Attribute VB_PredeclaredId = True
  76. Attribute VB_Exposed = False
  77. Option Explicit
  78. Dim hwnd1 As Long
  79. Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
  80. Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
  81. Const SWP_HIDEWINDOW = &H80
  82. Const SWP_SHOWWINDOW = &H40
  83. Private Sub cmdHide_Click()
  84. ' Hide the taskbar
  85. hwnd1 = FindWindow("Shell_traywnd", "")
  86. Call SetWindowPos(hwnd1, 0, 0, 0, 0, 0, SWP_HIDEWINDOW)
  87. End Sub
  88. Private Sub cmdShow_Click()
  89. ' Show the taskbar
  90. Call SetWindowPos(hwnd1, 0, 0, 0, 0, 0, SWP_SHOWWINDOW)
  91. End Sub
  92.